package com.cx.service.Impl;

import com.cx.entity.Dept;
import com.cx.mapper.DeptMapper;
import com.cx.service.DeptService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Data
@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public List<Dept> selectAllDept() {
        return deptMapper.selectAllDept();
    }

    @Override
    public Dept selectDeptById(int id) {
        return deptMapper.selectDeptById(id);
    }

    @Override
    public Boolean deleteDept(int id) {
        return deptMapper.deleteDept(id) > 0;

    }

    @Override
    public Boolean insertDept(Dept dept) {
        return deptMapper.insertDept(dept) > 0;
    }

    @Override
    public Boolean updateDept(Dept dept) {
        return deptMapper.updateDept(dept) > 0;
    }
}
